﻿using EasyAbp.Abp.SettingUi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
using WeChat.CMS.Localization;
using WeChat.CMS.WeChatManagers;
using static WeChat.CMS.Settings.CMSSettings;

namespace WeChat.CMS.Settings
{
    public class CMSSettingDefinitionProvider : SettingDefinitionProvider
    {
        public override void Define(ISettingDefinitionContext context)
        {

            context.Add(
                [
                   new SettingDefinition(
                       "Connection.Ip", // 设置的名称
                       "127.0.0.1", // 默认值
                       L("Setting:Connection.Ip:DisplayName"), // 显示名称
                       L("Setting:Connection.Ip:Description") // 描述
                   ).WithProperty(SettingUiConst.Group1, "Setting:Server") //一级类别
                    .WithProperty(SettingUiConst.Group2, "Setting:Connect"), //二级类别

                     new SettingDefinition(
                       "Connection.Port", // 设置的名称
                       "127.0.0.1", // 默认值
                       L("Setting:Connection.Port:DisplayName"), // 显示名称
                       L("Setting:Connection.Port:Description") // 描述
                   )
                     .WithProperty(SettingUiConst.Type,"number")
                     .WithProperty(SettingUiConst.Group1, "Setting:Server") //一级类别
                    .WithProperty(SettingUiConst.Group2, "Setting:Port"),  //二级类别

                    new SettingDefinition("Connection.OS",
                     null,
                     L("Setting:Connection.OS:DisplayName"),
                     L("Setting:Connection.OS:Description"))
                     .WithProperty(SettingUiConst.Group1, "Setting:Server") //一级类别
                    .WithProperty(SettingUiConst.Group2, "Setting:OS")
                    .WithProperty(SettingUiConst.Type,"select")
                    .WithProperty(SettingUiConst.Options,"IOS|Windows|Linux")
                    ,  //二级类别
                    

            ]


           );
        }

        private static LocalizableString L(string name)
        {
            return LocalizableString.Create<CMSResource>(name);
        }
    }
}
